package com.example.word.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author yuwen
 * @date 2023/4/17
 */
@Getter
@AllArgsConstructor
public enum LineSpacingEnum {
    DANBEI(12.0f, "单倍行距"),
    YDWBEI(18.0f, "1.5倍行距"),
    ERBEI(24.0f, "二倍行距");


    /**
     * 字体大小
     */
    private final float spacingSize;

    /**
     * 字体大小对应名称
     */
    private final String spacingName;

    public static String getSpacingName(float spacingSize){
        for (LineSpacingEnum value : LineSpacingEnum.values()) {
            if(value.getSpacingSize() == spacingSize){
                return value.getSpacingName();
            }
        }
        return null;
    }

}
